package com.ljz.controller;

import com.ljz.dao.PersonProperties;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by jiazhang on 2017/4/11.
 */

@RestController
public class HelloController {

//    @RequestMapping("/hello")
//    public String say() {
//        return "Hello SpringBoot";
//    }
//
//    @Value("${name}")
//    public String name;
//
//    @RequestMapping(value = "/hello",method = RequestMethod.GET)
//    public String says() {
//        return name;
//    }

    @Autowired
    private PersonProperties personProperties;

    @RequestMapping(value = "/hello",method = RequestMethod.GET)
    public String sayr() {
        return personProperties.getName() + personProperties.getAge();
    }
}
